package com.ruoyi.yljf.controller.AppController;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.yljf.domain.vo.ExamSummaryDetailVO;
import com.ruoyi.yljf.service.IExamSummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/api/exam/summary")
public class ApiExamSummaryController extends BaseController {


    @Autowired
    private IExamSummaryService examSummaryService;

    @GetMapping("/getExamSummaryByCourseIdAndPackageId")
    public AjaxResult getExamSummary(@RequestParam("courseId") Long courseId,
                                     @RequestParam("packageId") Long packageId) {


        List<ExamSummaryDetailVO> result = examSummaryService.getExamSummary(getUserId(), courseId, packageId);
        if (result.size() == 0 || result == null)
            return success();
        return success(result);
    }


}
